<?php
/**
 * Created by PhpStorm.
 * User: mf
 * Date: 2017/9/9
 * Time: 10:23
 */
namespace app\admin\controller;

use tool\Common;
use app\admin\logic\User as LogicUser;

class Base
{
    public function __construct()
    {
        $controller = strtolower(request()->controller());
        $action = strtolower(request()->action());
        if ($action == 'login' && $controller == 'user') {
            return ;
        }
        if ($action == 'getSellerMsg' && $controller == 'user') {
            return ;
        }
        $package = (new LogicUser())->checkLogin();
        if($package['code'] != 1) {
            $package['code'] = -1000;
            $package['msg'] = '需要重新登录';
            Common::json($package);
        }
        return;
    }
}